<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>构造函数实现假继承</title>
    <script type="text/javascript">
        window.onload = function(){
            function Super(name,age){
                this.name = name;
                this.age = age;
            }
            function Children(name,age,price){
                //调用父类
                Super.call(this,name,age);
                this.price = price;
            }
            Children.prototype.toString = function(){
                return this.name +"-"+ this.age +"-"+this.price;
            }
            let children = new Children('jack',12,2);
            console.log(children.toString());
        }
    </script>
</head>
<body>
    
</body>
</html>